import request from '@/utils/request'

const baseApi = '/xmtsc-api'

// 全部职位
export function list(data) {
    return request({
        url: baseApi + '/api/companyposition/getAllPositions',
        method: 'post',
        data: data
    })
}

// 查询单个招聘职位信息
export function detail(id) {
    return request({
        url: baseApi + '/api/companyposition/findPositionById',
        method: 'post',
        data: {id:id}
    })
}

//新增or更新招聘职位信息
export function addOrUpdatePosition(data) {
    return request({
        url: baseApi + '/api/companyposition/addOrUpdatePosition',
        method: 'post',
        data: data
    })
}

//删除职位
export function del(id) {
    return request({
        url: baseApi + '/api/companyposition/deletePosition',
        method: 'delete',
        data: {id: id}
    })
}

//批量删除职位
export function deleteBatchPosition(data) {
    return request({
        url: baseApi + '/api/companyposition/deleteBatchPosition',
        method: 'post',
        data: data
    })
}
